package com.superman.thread;

import cn.hutool.core.thread.ThreadUtil;
import com.superman.thread.func.TakeNothingReturnHaving;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

/**
 * Author: superman
 * Date: 2024/5/23 9:10
 */
@Slf4j
public class Demo01 {

    public static Thread thread;


    public static void main(String[] args) throws Exception {

        TaskManager taskManager = new TaskManager.Builder().build();


        String taskId = taskManager.submitTask("333", false, Test01::test1);

        for (int i = 0; i < 100; i++) {
            System.out.println(taskManager.getTask(taskId));
            ThreadUtil.sleep(1000);
        }


    }
}
